//
//  TZBarButtonItem+Extension.swift
//  WeiboWithSwift
//
//  Created by 涂真 on 15/12/21.
//  Copyright © 2015年 涂真. All rights reserved.
//

import UIKit
extension UIBarButtonItem{
     ///便利构造函数创建有图片的UIBarButtonItem
    convenience init(imageName:String) {
        let highlightImageName = "\(imageName)_highlighted"
        let button = UIButton()
        button.setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        button.setImage(UIImage(named: highlightImageName), forState: UIControlState.Highlighted)
        button.sizeToFit()
        self.init(customView:button)
    }
    
    //    func creatBarButtonItem(imageName:String,title:String){
    //
    //        let buttom = UIButton()
    //
    //    }
}
